import axios from '@/utils/axios'
import MockAdapter from 'axios-mock-adapter';
import loginAPI from './login'
import userAPI from './user'

const mock = new MockAdapter(axios);

// 登录相关 ,第二个参数为拦截到相关请求后的处理回调函数，参数为
mock.onPost('/login/login').reply(loginAPI.loginByUsername);
mock.onPost('/login/logout').reply(loginAPI.logout);
mock.onGet('/user/info').reply(loginAPI.getUserInfo);

// 用户相关
mock.onGet('/user/list').reply(userAPI.getList)
mock.onPost('/uploadAvatar').reply( userAPI.uploadAvatar)
mock.onPost('/user/add').reply( userAPI.createUser)
mock.onPost('/user/update').reply( userAPI.updateUser)
mock.onPost('/user/delete').reply( userAPI.deleteUser)
